<template>
<div>
  <button @click="show=!show">切换动画</button>
  <transition name="fade">
  	<div v-if="show">Hello Vue3!</div>
  </transition>
</div>
</template>
<script>
export default{
  data(){
  	return {
  	  show:false,
  	}
  }
}
</script>
<style scoped>
.fade-enter-active,.fade-leave-active{
  transition:opacity 0.5s ease;
}
.fade-enter-from,.fade-leave-to{
  opacity:0;
}
</style>